<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css圣杯布局</title>
    <style type="text/css">
        .clearfix::after{
            clear: both;
        }
        .wrap{
            width: 700px;
            margin: 0 auto;
        }
        .top,.foot{
            height: 50px;
            background-color: #000;
        }
        .main{
            padding: 0 100px;
            overflow: hidden;
        }
        .main .left,
        .main .center,
        .main .right{
            float: left;
            position: relative;
            background-color: green;
            margin-bottom: -4000px;
            padding-bottom: 4000px;
        }
        .main .right{
            width: 100px;
            left: 100px;
            margin-left: -100px;
        }
        .main .left{
            width: 100px;
            left: -100px;
        }
        .main .center{
            background-color: red;
            margin-left: -100px;
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="top"></div>
        <div class="main clearfix">
            <div class="left">123</div>
            <div class="center">123</div>
            <div class="right">123</div>
        </div>
        <div class="foot"></div>
    </div>
</body>
</html>